import {defineStore} from 'pinia';
import {reactive,ref} from 'vue';
import { ClassApi } from "@/api";

export default defineStore('class' , () => {
    const isInit = ref<boolean>(false);
    let allClss = reactive<Array<Vm.Class>>([]);
    const init = async () => {
        if(isInit.value) return;
        allClss.push(...await ClassApi.getAll());
        isInit.value = true;
    }
    return {allClss , init}
})